﻿using System;
using System.Collections.Generic;
using AdAggregator.Monitoring;

namespace ClothingAggregator.Models.Monitoring
{
    public class MyMonitoringTask
    {
        public string Id { get; set; }
        public virtual ICollection<MyMonitoringResult> History { get; set; }
        public int Frequency { get; set; }
        public bool Active { get; set; }
        public DateTime CreatedAt { get; set; }

        public MyMonitoringTask()
        {
            CreatedAt = DateTime.Now;
        }

        public MyMonitoringTask(IMonitoringTask other)
        {
            Active = other.Active;
            Frequency = other.Frequency;
            Id = other.Id;
            CreatedAt = DateTime.Now;
        }

        public IMonitoringTask ToMonitoringTask()
        {
            return new MonitoringTask
                {
                    Active = Active,
                    Frequency = Frequency,
                    Id = Id
                };
        }

    }
}